/**
 * 
 */
package net.wisos.opn.dao;

import java.util.Date;
import java.util.List;

import net.wisos.opn.account.entity.User;
import net.wisos.opn.entity.Order;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;


/**
 * @author Liuye
 * 
 */
public interface OrderDao extends PagingAndSortingRepository<Order, Long> {

	Page<Order> findByOrderDateBetween(Date startDate, Date endDate,
			Pageable pageable);

	@Query("from order o where o.customer > :customer")
	public List<Order> findByCustomer(@Param("customer") User customer);
}
